package org.algorithm.二师兄.数组.三月.第四周;

import org.junit.Test;

/**
 * @author zhx
 * @version 1.0
 * @date 2022/03/24 8:38 PM
 * @description: 周五
 *
 *
 * url: https://leetcode-cn.com/problems/qing-wa-tiao-tai-jie-wen-ti-lcof/
 */
public class 青蛙跳台阶 {

    public static void main(String[] args) {
        System.out.println(numWays(3%1000000007));
    }

    public static int numWays(int n) {
        int[] dp = new int[Math.max(n + 1, 3)];
        dp[0] = 1;
        dp[1] = 1;
        dp[2] = 2;

        for (int i = 3; i <= n; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
        }
        return dp[n];
    }

}
